package cz.muni.pa036.hockeyStats;

/***********************************************************************
 * Module:  Game.java
 * Author:  Rojko
 * Purpose: Defines the Class Game
 ***********************************************************************/

import java.util.*;

/** @pdOid 03e6b86d-37da-418d-9a07-417e4dad3c46 */
public class Game {
   /** @pdOid 7835a0dd-a17f-4069-8a2d-2fa7b7f90a71 */
   public int idGame;
   /** @pdOid 5c497e1c-2116-442f-890a-4376894a2b1b */
   public java.util.Date date;
   /** @pdOid bd2f940b-dc86-4510-8ec8-1d3c9017eee0 */
   public java.lang.String leagueName;
   
   /** @pdRoleInfo migr=no name=GameOfficials assc=relationship21 coll=java.util.Collection impl=java.util.HashSet mult=1..* type=Composition side=A */
   public java.util.Collection<GameOfficials> gameOfficials;
   /** @pdRoleInfo migr=no name=GamePlayers assc=relationship11 coll=java.util.Collection impl=java.util.HashSet mult=0..* type=Composition side=A */
   public java.util.Collection<GamePlayers> gamePlayers;
   
   
   /** @pdGenerated default getter */
   public java.util.Collection<GameOfficials> getGameOfficials() {
      if (gameOfficials == null)
         gameOfficials = new java.util.HashSet<GameOfficials>();
      return gameOfficials;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorGameOfficials() {
      if (gameOfficials == null)
         gameOfficials = new java.util.HashSet<GameOfficials>();
      return gameOfficials.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newGameOfficials */
   public void setGameOfficials(java.util.Collection<GameOfficials> newGameOfficials) {
      removeAllGameOfficials();
      for (java.util.Iterator iter = newGameOfficials.iterator(); iter.hasNext();)
         addGameOfficials((GameOfficials)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newGameOfficials */
   public void addGameOfficials(GameOfficials newGameOfficials) {
      if (newGameOfficials == null)
         return;
      if (this.gameOfficials == null)
         this.gameOfficials = new java.util.HashSet<GameOfficials>();
      if (!this.gameOfficials.contains(newGameOfficials))
         this.gameOfficials.add(newGameOfficials);
   }
   
   /** @pdGenerated default remove
     * @param oldGameOfficials */
   public void removeGameOfficials(GameOfficials oldGameOfficials) {
      if (oldGameOfficials == null)
         return;
      if (this.gameOfficials != null)
         if (this.gameOfficials.contains(oldGameOfficials))
            this.gameOfficials.remove(oldGameOfficials);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllGameOfficials() {
      if (gameOfficials != null)
         gameOfficials.clear();
   }
   /** @pdGenerated default getter */
   public java.util.Collection<GamePlayers> getGamePlayers() {
      if (gamePlayers == null)
         gamePlayers = new java.util.HashSet<GamePlayers>();
      return gamePlayers;
   }
   
   /** @pdGenerated default iterator getter */
   public java.util.Iterator getIteratorGamePlayers() {
      if (gamePlayers == null)
         gamePlayers = new java.util.HashSet<GamePlayers>();
      return gamePlayers.iterator();
   }
   
   /** @pdGenerated default setter
     * @param newGamePlayers */
   public void setGamePlayers(java.util.Collection<GamePlayers> newGamePlayers) {
      removeAllGamePlayers();
      for (java.util.Iterator iter = newGamePlayers.iterator(); iter.hasNext();)
         addGamePlayers((GamePlayers)iter.next());
   }
   
   /** @pdGenerated default add
     * @param newGamePlayers */
   public void addGamePlayers(GamePlayers newGamePlayers) {
      if (newGamePlayers == null)
         return;
      if (this.gamePlayers == null)
         this.gamePlayers = new java.util.HashSet<GamePlayers>();
      if (!this.gamePlayers.contains(newGamePlayers))
         this.gamePlayers.add(newGamePlayers);
   }
   
   /** @pdGenerated default remove
     * @param oldGamePlayers */
   public void removeGamePlayers(GamePlayers oldGamePlayers) {
      if (oldGamePlayers == null)
         return;
      if (this.gamePlayers != null)
         if (this.gamePlayers.contains(oldGamePlayers))
            this.gamePlayers.remove(oldGamePlayers);
   }
   
   /** @pdGenerated default removeAll */
   public void removeAllGamePlayers() {
      if (gamePlayers != null)
         gamePlayers.clear();
   }

}